Adverbial phrase of mode. Made and metaphorical phrase which means that someone about to get something, when you have one close by, just by losing it.